package net.sk.china.platform.service.system;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.platform.model.system.SystemAttachment;
import net.sk.china.platform.request.system.SystemAttachmentMoveRequest;
import net.sk.china.platform.request.system.SystemAttachmentRequest;
import net.sk.china.common.request.PageParamRequest;

import java.util.List;
import java.util.Map;

/**
 * SystemAttachmentService 接口
 * +----------------------------------------------------------------------
 * // | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * // +----------------------------------------------------------------------
 * // | Copyright (c) 2018-2024 聊来 All rights reserved.
 * // +----------------------------------------------------------------------
 * // | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * // +----------------------------------------------------------------------
 * // | @Author: 聊来 <18970881148@qq.com>
 * // +----------------------------------------------------------------------
 * // | DateTime: 2024/6/3 16:01
 * // +----------------------------------------------------------------------
 */
public interface SystemAttachmentService extends IService<SystemAttachment> {

    /**
     * 给图片加前缀
     * @param path String 路径
     * @return {@code String}
     */
    String prefixImage(String path);

    /**
     * 同步到云服务， 更新图片上传类型
     * @param attId Integer 主键id
     * @param type int 图片上传类型 1本地 2七牛云 3OSS 4COS
     */
    void updateCloudType(Integer attId, int type);

    /**
     * 附件分页
     * @param map 查询条件
     * @param pageParamRequest PageParamRequest 分页参数
     * @return {@code List<SystemAttachment>}
     */
    List<SystemAttachment> getList(Map<String, Object> map, PageParamRequest pageParamRequest);


    /**
     * 新增附件
     * @param systemAttachmentRequest 新增参数
     * @return {@code boolean}
     */
    boolean add(SystemAttachmentRequest systemAttachmentRequest);

    /**
     * 编辑附件
     * @param systemAttachmentRequest 更新参数
     * @return {@code boolean}
     */
    boolean edit(SystemAttachmentRequest systemAttachmentRequest);

    /**
     * 更改图片目录
     * @param move 参数
     * @return {@code boolean}
     */
    boolean updateAttrId(SystemAttachmentMoveRequest move);

    /**
     * 清除 cdn url， 在保存数据的时候使用
     * @param path String 文件路径
     * @return {@code String}
     */
    String clearPrefix(String path);
}
